CentOS 7
Sponsored Link

OpenStack Pike : How to use Ceilometer(Nova Compute)
2017/09/27
 
This is how to use OpenStack Telemetry Service (Ceilometer) for Nova Compute service.
This example is based on the emvironment like follows.
     ------------+---------------------------+---------------------------+------------
                 |                           |                           |
             eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
     +-----------+-----------+   +-----------+-----------+   +-----------+-----------+
     |    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
     |                       |   |                       |   |                       |
     |  MariaDB    RabbitMQ  |   |      Open_vSwitch     |   |        Libvirt        |
     |  Memcached  httpd     |   |        L2_Agent       |   |     Nova_Compute      |
     |  Keystone   Glance    |   |        L3_Agent       |   |      Open_vSwitch     |
     |  Nova_API  Cinder_API |   |     Metadata_Agent    |   |        L2_Agent       |
     |  Neutron_Server       |   |     Cinder_Volume     |   |  Ceilometer_Compute   |
     |  Metadata_Agent       |   |        Heat_API       |   |                       |
     |  Gnocchi              |   |      Heat Engine      |   |                       |
     |  Ceilometer_Central   |   |                       |   |                       |
     +-----------------------+   +-----------------------+   +-----------------------+

[1] Change settings for Nova Compute service to enable Telemetry data collention like follows.
[root@node01 ~]#
vi /etc/nova/nova.conf
# add follows into [DEFAULT] section

instance_usage_audit = True
instance_usage_audit_period = hour
notify_on_state_change = vm_and_task_state
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
[root@node01 ~]#
systemctl restart openstack-nova-compute

[2] It's some example to display metrics and meters.
# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------+----------------------------------+
| id                                   | type     | project_id                       |
+--------------------------------------+----------+----------------------------------+
| 81563c32-75b3-4426-a0a9-95390d6fddf5 | instance | 27f776933c3b469ba0c07deba6b57752 |
+--------------------------------------+----------+----------------------------------+
----------------------------------+--------------------------------------+----------------------------------+
 user_id                          | original_resource_id                 | started_at                       |
----------------------------------+--------------------------------------+----------------------------------+
 8145f0cd8aab4d00b36f2d2da4ba5337 | 81563c32-75b3-4426-a0a9-95390d6fddf5 | 2017-09-29T06:13:49.003232+00:00 |
----------------------------------+--------------------------------------+----------------------------------+
----------+----------------------------------+--------------+-----------------------------------------------+
 ended_at | revision_start                   | revision_end | creator                                       |
----------+----------------------------------+--------------+-----------------------------------------------+
 None     | 2017-09-29T06:13:49.003272+00:00 | None         | f3ddbcb50b35481786dc468e49181678:626d31665c71 |
----------+----------------------------------+--------------+-----------------------------------------------+

# test to create and boot instance

[root@dlp ~(keystone)]#
Int_Net_ID=`openstack network list | grep int_net | awk '{ print $2 }'`

[root@dlp ~(keystone)]#
openstack server create --flavor m1.small --image CentOS7 --security-group default --nic net-id=$Int_Net_ID --key-name mykey CentOS_7

# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------+----
| id                                   | type                       | project_id                       | ... 
+--------------------------------------+----------------------------+----------------------------------+----
| 81563c32-75b3-4426-a0a9-95390d6fddf5 | instance                   | 27f776933c3b469ba0c07deba6b57752 | ...
| 4d76f4a5-4fd5-4a4e-a901-16b3f829e707 | instance                   | 27f776933c3b469ba0c07deba6b57752 | ...
| 23074d05-2d5d-56f5-9ac8-1802e2cec728 | instance_network_interface | 27f776933c3b469ba0c07deba6b57752 | ...
+--------------------------------------+----------------------------+----------------------------------+----

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show 4d76f4a5-4fd5-4a4e-a901-16b3f829e707

+-----------------------+---------------------------------------------------------------------+
| Field                 | Value                                                               |
+-----------------------+---------------------------------------------------------------------+
| created_by_project_id | 626d31665c7140ab82d88b78c4073798                                    |
| created_by_user_id    | f3ddbcb50b35481786dc468e49181678                                    |
| creator               | f3ddbcb50b35481786dc468e49181678:626d31665c7140ab82d88b78c4073798   |
| ended_at              | None                                                                |
| id                    | 4d76f4a5-4fd5-4a4e-a901-16b3f829e707                                |
| metrics               | compute.instance.booting.time: f7299d60-2617-4224-aab6-6ca98ac87cf2 |
|                       | cpu.delta: c8116e9d-f2d3-4f68-a093-8ab49906cbaf                     |
|                       | cpu: 37ffb410-415d-4f8a-9660-7fe4db993048                           |
|                       | cpu_l3_cache: 50f64b37-144d-4ad6-bc84-08516c071df3                  |
|                       | cpu_util: d312f000-bc66-4458-8593-fbcd7a02ee27                      |
|                       | disk.allocation: afbbf0c8-c063-4907-9470-dfd9fcb8a932               |
|                       | disk.capacity: db1674cb-8944-45ce-a89b-d2ce13a6b84e                 |
|                       | disk.ephemeral.size: 72f47696-a362-4c9d-a94b-36b88be7a185           |
|                       | disk.iops: 7e48a531-b9e8-4db2-a04b-2aadc51fe6bd                     |
|                       | disk.latency: dc788852-b28d-44ce-919c-71e57b57af85                  |
|                       | disk.read.bytes.rate: 305024e3-8a58-4cc2-97c0-155628043a4d          |
|                       | disk.read.bytes: 53a3de11-6852-4169-9a01-8f863ff426c3               |
|                       | disk.read.requests.rate: 6175de5f-ee7c-4459-9c94-aaabdf446e31       |
|                       | disk.read.requests: a8dc2267-9c5b-4a85-b5dc-04310897adfb            |
|                       | disk.root.size: 0ce8f23b-7e73-4940-9ba5-f571eb2453a7                |
|                       | disk.usage: f9f0261e-0a1c-4741-baf8-473041014204                    |
|                       | disk.write.bytes.rate: 6643b9ba-07c8-4a98-ac8b-b86a6907a8f5         |
|                       | disk.write.bytes: 2a25088f-2f56-478d-8bef-96c6baeb271a              |
|                       | disk.write.requests.rate: e27ab09a-da64-412b-882f-d10b71a903c7      |
|                       | disk.write.requests: 3bd7e74a-04b2-4d7c-ae20-8fa8a58f6718           |
|                       | memory.bandwidth.local: 33bb8652-1822-4460-bfee-30c41441809b        |
|                       | memory.bandwidth.total: 61779e4c-be23-4989-9ef2-3e756d4706b4        |
|                       | memory.resident: e9d34c03-1612-460a-b2b2-dcfb0c13c8bd               |
|                       | memory.swap.in: 1e34fd6c-ef73-41be-9ce8-389053b86abe                |
|                       | memory.swap.out: e6ce9192-bb90-42df-8f99-b07893d9b3f0               |
|                       | memory.usage: b8f78e8c-33ee-4335-ac4d-08fc92b3ab51                  |
|                       | memory: 00bed8b0-8e42-44e5-8eaa-f274a9d46e07                        |
|                       | perf.cache.misses: b7eb3414-e5f3-41e6-a906-9aea078846a3             |
|                       | perf.cache.references: 1104ede8-025f-4d90-9bcd-16cd72f33ea4         |
|                       | perf.cpu.cycles: f869ca0f-3174-4661-937f-4fb3c6496132               |
|                       | perf.instructions: 36d106fe-e44c-4605-ac32-0ee53b091fff             |
|                       | vcpus: 2b52e967-0176-481a-8e60-a30fdeaa84cb                         |
| original_resource_id  | 4d76f4a5-4fd5-4a4e-a901-16b3f829e707                                |
| project_id            | 27f776933c3b469ba0c07deba6b57752                                    |
| revision_end          | None                                                                |
| revision_start        | 2017-09-29T06:25:09.634903+00:00                                    |
| started_at            | 2017-09-29T06:25:09.634877+00:00                                    |
| type                  | instance                                                            |
| user_id               | 8145f0cd8aab4d00b36f2d2da4ba5337                                    |
+-----------------------+---------------------------------------------------------------------+

# display instance boot time

[root@dlp ~(keystone)]#
openstack metric measures show f7299d60-2617-4224-aab6-6ca98ac87cf2

+---------------------------+-------------+-----------+
| timestamp                 | granularity |     value |
+---------------------------+-------------+-----------+
| 2017-09-29T06:25:00+00:00 |       300.0 | 13.317267 |
+---------------------------+-------------+-----------+

# display CPU

[root@dlp ~(keystone)]#
openstack metric measures show 37ffb410-415d-4f8a-9660-7fe4db993048

+---------------------------+-------------+---------------+
| timestamp                 | granularity |         value |
+---------------------------+-------------+---------------+
| 2017-09-29T06:25:00+00:00 |       300.0 | 25790000000.0 |
| 2017-09-29T06:30:00+00:00 |       300.0 | 27740000000.0 |
+---------------------------+-------------+---------------+

# display memory usage

[root@dlp ~(keystone)]#
openstack metric measures show b8f78e8c-33ee-4335-ac4d-08fc92b3ab51

+---------------------------+-------------+-------+
| timestamp                 | granularity | value |
+---------------------------+-------------+-------+
| 2017-09-29T06:25:00+00:00 |       300.0 | 178.0 |
| 2017-09-29T06:30:00+00:00 |       300.0 | 178.0 |
+---------------------------+-------------+-------+

# details of instance_network_interface

[root@dlp ~(keystone)]#
openstack metric resource show 23074d05-2d5d-56f5-9ac8-1802e2cec728

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | 626d31665c7140ab82d88b78c4073798                                      |
| created_by_user_id    | f3ddbcb50b35481786dc468e49181678                                      |
| creator               | f3ddbcb50b35481786dc468e49181678:626d31665c7140ab82d88b78c4073798     |
| ended_at              | None                                                                  |
| id                    | 23074d05-2d5d-56f5-9ac8-1802e2cec728                                  |
| metrics               | network.incoming.bytes.rate: 2cb224af-6094-4caa-8a7a-701392a7c8ae     |
|                       | network.incoming.bytes: 68773453-38e6-42a3-9ae8-5da26f96b80d          |
|                       | network.incoming.packets.drop: 8afe818d-6a64-442e-b4ff-6e78d1d0ec8d   |
|                       | network.incoming.packets.error: f077a543-b98a-421a-9399-08a976500546  |
|                       | network.incoming.packets.rate: 2b6e3589-bf2e-4aac-aa37-424967e0e0f1   |
|                       | network.incoming.packets: ff073a3b-a0a3-4a71-9aa8-ffd3ffeeec4c        |
|                       | network.outgoing.bytes.rate: 69e095df-d1fc-4b32-b854-021fa87d2fb7     |
|                       | network.outgoing.bytes: 77f09e31-d97c-4a32-baa5-cb3795576495          |
|                       | network.outgoing.packets.drop: cd22c17e-82dc-402d-aa2a-90983bd70ae4   |
|                       | network.outgoing.packets.error: 95115323-5240-4fa4-91bf-988ae911c613  |
|                       | network.outgoing.packets.rate: e838bd96-fc14-4e81-aba3-0d30b1a55237   |
|                       | network.outgoing.packets: f2f57fc8-255f-4123-947e-fe05a8c52f0c        |
| original_resource_id  | instance-00000004-4d76f4a5-4fd5-4a4e-a901-16b3f829e707-tap005cc758-bb |
| project_id            | 27f776933c3b469ba0c07deba6b57752                                      |
| revision_end          | None                                                                  |
| revision_start        | 2017-09-29T06:28:02.574870+00:00                                      |
| started_at            | 2017-09-29T06:28:02.574839+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | 8145f0cd8aab4d00b36f2d2da4ba5337                                      |
+-----------------------+-----------------------------------------------------------------------+

# display network incoming bytes

[root@dlp ~(keystone)]#
openstack metric measures show 68773453-38e6-42a3-9ae8-5da26f96b80d

+---------------------------+-------------+---------+
| timestamp                 | granularity |   value |
+---------------------------+-------------+---------+
| 2017-09-29T06:25:00+00:00 |       300.0 | 23828.0 |
| 2017-09-29T06:30:00+00:00 |       300.0 | 25604.0 |
| 2017-09-29T06:35:00+00:00 |       300.0 | 27518.0 |
+---------------------------+-------------+---------+

# display network outgoing bytes

[root@dlp ~(keystone)]#
openstack metric measures show 77f09e31-d97c-4a32-baa5-cb3795576495

+---------------------------+-------------+---------+
| timestamp                 | granularity |   value |
+---------------------------+-------------+---------+
| 2017-09-29T06:25:00+00:00 |       300.0 | 22662.0 |
| 2017-09-29T06:30:00+00:00 |       300.0 | 24438.0 |
| 2017-09-29T06:35:00+00:00 |       300.0 | 26532.0 |
+---------------------------+-------------+---------+
 
Tweet